#ifndef _ACCEPTOR_HH
#define _ACCEPTOR_HH

#include <sys/types.h>
#include <sys/socket.h>
#include "Socket.hh"
#include "InetAddress.hh"

#include <string>

using std::string;

class Acceptor 
{
public:
    Acceptor(string ip, unsigned short port);
    ~Acceptor();

    void Ready();
    int Accept();
    int Get_fd() const;

private:
    void Set_reuse_addr();
    void Set_reuse_port();
    void Bind();
    void Listen();

private: 
    Socket _sock_fd;
    InetAddress _addr;
};

#endif